:root {
  --border-width: 5px;
}
body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #ccc;
}

.btn-container {
  width: 200px;
  height: 50px;
  position: relative;
  background: #ccc;
  border-radius: 15px;
  z-index: 0;
  overflow: hidden;
}

.btn {
  width: calc(100% - var(--border-width) * 2);
  height: calc(100% - var(--border-width) * 2);
  margin: var(--border-width);
  border-radius: 15px;
  background: linear-gradient(to right, #74b9ff, #0984e3);
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn::before {
  content: "";
  position: absolute;
  bottom: 50%;
  right: 50%;
  width: 220px;
  height: 220px;
  background: linear-gradient(270deg, #000, yellow 20%);
  z-index: -1;
  animation: btn-anim 1.5s linear infinite;
  transform-origin: bottom right;
}

.btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 220px;
  height: 220px;
  background: linear-gradient(90deg, #000, yellow 20%);
  z-index: -1;
  animation: btn-anim 1.5s linear infinite;
  transform-origin: 0 0;
}

@keyframes btn-anim {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
